///areaFactory(binary_rect_array tilesTemplate) 1 for tile, 0 for blank
var area = instance_create(0, 0, obj_Module);
var tilesTemplate = argument0;
var width = array_length_2d(tilesTemplate, 0);
var height = array_height_2d(tilesTemplate);
for (var iii = 0; iii < width; iii++)
{
    for (var jjj = 0; jjj < height; jjj++)
    {
        if (tilesTemplate[jjj, iii] != 0)
        {
            var tile = 0;
            tile = instance_create(0, 0, obj_Tile);
            setTile(iii, jjj, tile, area);
            tile.sprite_index = spr_Floor;
        }
        else
        {
            area.tiles[jjj, iii] = 0;
        }
    }
}
return area;

